import request from "@/util/request";

const apiurl = "/system/adminUser/"

/*获取登录人的详细信息*/
export function getMyInfo() {
    return request({
        method: 'get',
        url: apiurl + 'getMyInfo',
    })
}

export function getAllUsers(pageNum, pageSize) {
    return request({
        method: 'get',
        url: apiurl + `getAllUsers/${pageNum}/${pageSize}`,
    })
}

/*搜索用户*/
export function UserSearch(data) {
    return request({
        method: 'post',
        url: apiurl + `UserSearch`,
        data
    })
}

/*获取用户详细信息*/
export function getUserInfo(userId) {
    return request({
        method: 'get',
        url: apiurl + 'getUserInfo',
        params: {
            userId: userId
        }
    })
}export function getUserListFromRoleKeys(data){
    return request({
        method: 'post',
        url: apiurl + `get/user/list/from/roleKeys`,
        data
    })
}

/*添加用户*/
export function addAdminUser(data) {
    return request({
        method: 'post',
        url: apiurl + 'addAdminUser',
        data
    })
}
/*修改用户信息*/
export function updateAdminUser(data){
    return request({
        method: 'put',
        url: apiurl + 'updateAdminUser',
        data
    })
}
export function getUserCompositionStatistic() {
    return request({
        method: 'get',
        url: apiurl+'userCompositionStatistic',
    })
}
